/**
 * CategoryList.java
 * 
 * FreeZzaph is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 3 of
 * the License, or (at your option) any later version.
 *
 * FreeZzaph is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; see the file COPYING.
 */
package freezzaph.plugins;

import java.util.HashMap;

/**
 * <p>Represents a category list. A category list is typically
 * a list of categories within the same "umbrella" category.
 * The two most common in the porn world are "pictures" and
 * "movies/videos", which likely will be the two most
 * common category list types in all plugins.
 * 
 * <p>The type should be short, all lowercase, contain no whitespace
 * and no special characters. Typical examples are "pictures" and
 * "movies".
 * 
 * <p>The description should be a more descriptive name for the category
 * list. Typically, this will be the same as the type, perhaps with an
 * additional noun, and with proper casing, such as "Picture galleries"
 * and "Movie galleries".
 * 
 * @author FreeZzaph
 */
public class CategoryList {
	
	private String type;
	private String description;
	private HashMap<String, Category> categories = new HashMap<String, Category>();
	
	/**
	 * Add a category to this CategoryList.
	 * 
	 * @param name the name of the category.
	 * @param category the category to add.
	 */
	public void addCategory(String name, Category category) {
		categories.put(name, category);
	}
	
	/**
	 * Remove a category from this CategoryList.
	 * 
	 * @param name the name of the category to remove.
	 */
	public void removeCategory(String name) {
		categories.remove(name);
	}

	/**
	 * Construct a new CategoryList of the given type
	 * with the given description.
	 * 
	 * @param type the type of CategoryList this is.
	 * This value should be short, all lowercase, contain no
	 * whitespace and no special characters. Typical examples
	 * are "pictures" and "movies".
	 * @param description the description of this CategoryList.
	 * This value should be a more descriptive name for the
	 * CategoryList. Typically, this will be the same as the type,
	 * perhaps with an additional noun, and with proper casing,
	 * such as "Picture galleries" and "Movie galleries"
	 */
	public CategoryList(String type, String description) {
		this.type = type;
		this.description = description;
	}

	/**
	 * Returns the type of the category list.
	 * 
	 * @return the type of the category list.
	 */
	public String getType() {
		return type;
	}

	/**
	 * Returns the description of the category list.
	 * 
	 * @return the description of the category list.
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Returns the HashMap containing the categories
	 * in this cateogrylist.
	 * 
	 * @return the HashMap containing the categories
	 * in this cateogrylist.
	 */
	public HashMap<String, Category> getCategories() {
		return categories;
	}

}
